import Ember from 'ember';
import config from 'game-front/config/environment';
import RSVP from 'rsvp';

export default Ember.Route.extend({
	actions:{
		home () {
			Ember.$(".shade").css({"display":"block"});
			Ember.$(".shade-gameshare").css({"display":"block"});
		},
		homeTo () {
			Ember.$(".shade").css({"display":"none"});
			Ember.$(".shade-gameshare").css({"display":"none"});
		}
	},
	game:Ember.inject.service(),
	model(params) {
		return RSVP.hash({
			userInfo: Ember.$.getJSON(config.apiBase + "members", {userId:params.key}),
			qrInfo:Ember.$.getJSON(config.apiBase + "share/qr", {userId:params.key}),
			gameInfo:this.get("game").getGameById(params.game_id)
		});
	}
});
